#include "PreCompile.hpp"
#include "PhysicalInputFiles.hpp"

namespace BuildNG
{
  //////////
  // PhysicalInputFiles
  void PhysicalInputFiles::init()
  {
    Glib::RefPtr<InputFilesTypeInfo> type_info(new InputFilesTypeInfo);
    type_info->set_create_func_from_ctor<PhysicalInputFiles>();
    type_info->set_xml_tag_name("file");
    input_files_types_registry.register_type(type_info);
  }

  void PhysicalInputFiles::shutdown()
  {
    // nothing
  }

  void PhysicalInputFiles::load_from_xml(const Xml::Element &xml)
  {
    path = xml.get_attribute_value("path");
  }


  std::vector<Glib::ustring> PhysicalInputFiles::get_files_list()
  {
    std::vector<Glib::ustring> ret;
    ret.push_back(path);
    return ret;
  }

  std::vector<Glib::ustring> PhysicalInputFiles::build_physical_files(BuildContext &context)
  {
    // we don't have to generate any files, so the result of this
    // function is the same as that of the get_files_list function.
    return get_files_list();
  }
}
